package com.lanou3g.HW_0521.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@WebListener()
public class AppListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {

        Set<String> loginUsers = new HashSet<>();
        ServletContext app = sce.getServletContext();
        app.setAttribute("loginUsers", loginUsers);

    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
